﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<link rel="stylesheet" type="text/css" media="screen" href="css/jquery-ui-1.8.1.custom.css" />
<link rel="stylesheet" type="text/css" media="screen" href="css/ui.jqgrid.css" />
<script src="js/jquery-1.5.2.min.js" type="text/javascript"></script>
<script src="js/i18n/grid.locale-cn.js" type="text/javascript"></script>
<script src="js/json2.js" type="text/javascript"></script>
<script type="text/javascript">
	$.jgrid.no_legacy_api = true;
	$.jgrid.useJSON = true;
</script>
<script src="js/jquery.jqGrid.min.js" type="text/javascript"></script>
<script type="text/javascript">
var subgridid;

function toExcel() {
	$("#df").attr("src","main?action=9&oper=excel");
};

function allocState(cellvalue, options, rowObject) {
	if (cellvalue == "1")
		return "<img src='images/greenball.gif' title='已下拨' />";
	
	if (cellvalue == "0")
		return "<img src='images/yellowball.gif' title='未下拨' />";
};

function setGrid() {
	jQuery("#list1").jqGrid({ 
			url:'main?action=9',
			hidegrid: "false",
			datatype: "json",
			colNames:['年月','视力残疾人数','视力残疾需要发放资金','听力残疾人数','听力残疾需要发放资金','言语残疾人数','言语残疾发放资金','肢体残疾人数','肢体残疾发放资金','智力残疾人数','智力残疾发放资金','精神残疾人数','精神残疾发放资金','多重残疾人数','多重残疾发放资金','人员合计','发放资金合计'], 
			colModel:[ 
					{name:'month',width:80, sortable:false},
					{name:'shili',width:80, sortable:false, align:'right'},
					{name:'shili1',width:120, sortable:false, align:'right'},
					{name:'tingli',width:80, sortable:false, align:'right'},
					{name:'tingli1',width:120, sortable:false, align:'right'},
					{name:'yanyu',width:80, sortable:false, align:'right'},
					{name:'yanyu1',width:120, sortable:false, align:'right'},
					{name:'zhiti',width:80, sortable:false, align:'right'},
					{name:'zhiti',width:120, sortable:false, align:'right'},
					{name:'zhili',width:80, sortable:false, align:'right'},
					{name:'zhili1',width:120, sortable:false, align:'right'},
					{name:'jingshen',width:80, sortable:false, align:'right'},
					{name:'jingshen',width:120, sortable:false, align:'right'},
					{name:'duochong',width:80, sortable:false, align:'right'},
					{name:'duochong1',width:120, sortable:false, align:'right'},
					{name:'totalnum',width:100, sortable:false, align:'right'},
					{name:'totalmoney',width:120, sortable:false, align:'right'}
			], 
			viewrecords: true,
			subGrid: true,
			height: 440,
			shrinkToFit: false,
			caption:"资金下拨信息",
			subGridRowExpanded: function(subgrid_id, row_id) {
				var subgrid_table_id, pager_id;
				subgrid_table_id = subgrid_id+"_t";
				subgridid = subgrid_table_id;
				
				$("#"+subgrid_id).html("<table id='"+subgrid_table_id+"' class='scroll'></table>");
				jQuery("#"+subgrid_table_id).jqGrid({
					url:"main?action=9&id="+row_id,
					datatype: "json",
					colNames: ['所属区','视力残疾人数','视力残疾需要发放资金','听力残疾人数','听力残疾需要发放资金','言语残疾人数','言语残疾发放资金','肢体残疾人数','肢体残疾发放资金','智力残疾人数','智力残疾发放资金','精神残疾人数','精神残疾发放资金','多重残疾人数','多重残疾发放资金','人员合计','发放资金合计'],
					colModel: [
						{name:'district',width:80, sortable:false, align:'right', formatter:'select', editoptions:{value:"0:总计;1:市辖区;2:桥东区;3:桥西区;4:高新区;5:宣化区;6:下花园区"}},
						{name:'shili',width:80, sortable:false, align:'right'},
						{name:'shili1',width:120, sortable:false, align:'right'},
						{name:'tingli',width:80, sortable:false, align:'right'},
						{name:'tingli1',width:120, sortable:false, align:'right'},
						{name:'yanyu',width:80, sortable:false, align:'right'},
						{name:'yanyu1',width:120, sortable:false, align:'right'},
						{name:'zhiti',width:80, sortable:false, align:'right'},
						{name:'zhiti',width:120, sortable:false, align:'right'},
						{name:'zhili',width:80, sortable:false, align:'right'},
						{name:'zhili1',width:120, sortable:false, align:'right'},
						{name:'jingshen',width:80, sortable:false, align:'right'},
						{name:'jingshen',width:120, sortable:false, align:'right'},
						{name:'duochong',width:80, sortable:false, align:'right'},
						{name:'duochong1',width:120, sortable:false, align:'right'},
						{name:'totalnum',width:80, sortable:false, align:'right'},
						{name:'totalmoney',width:120, sortable:false, align:'right'}
					],
					rowNum:7,
					height: '100%'
				});
			},
			subGridRowColapsed: function(subgrid_id, row_id) {
				// this function is called before removing the data
				var subgrid_table_id;
				subgrid_table_id = subgrid_id+"_t";
				jQuery("#"+subgrid_table_id).remove();
			}
	})}; 
	
	$(document).ready(function(){
		setGrid();
		$("#sf_excel").click(toExcel);
	});
</script>
<body style="background-color:#d9f1cc;">
				<iframe id="df"  name="df" src="" width=0 height=0 frameborder="0" ></iframe>
				<input type="button" id="sf_excel" value="导 出">
				<div id="RightPane"  >
					<div class="innertube">
					<table id="list1"></table>
				</div>
				</div>
</body>
